Data communications is the transmission of data from one computer or device to another. A Universal Serial Bus is an interface for data communications between a computer and external peripheral devices. A Universal Serial Bus follows a data communications protocol defined in the Universal Serial Bus (USB) Specification, Version 1.1. USB Specification version 1.1 supports two different rates for transmitting data: 1.5 Mega bits (Mbits) per second for low-speed devices and 12 Mbits/second for high-speed devices. Recently a USB Specification Version 2.0 was made available. USB Specification 2.0 extends the rate for transferring data from 12 Mbps on USB 1.1 up to 480 Mbps on USB 2.0.
In some digital data communication arrangements, transmitted serial bit streams must contain periodic logic level transitions that provide frequency information to a receiver. The frequency information is used for the purpose of locking onto the received data. It is not unusual to add (or “stuff”) one extra bit of information into a transmitted bit stream to force a transition when a transition has not occurred within a maximum amount of time that a receiver can be allowed to drift off frequency. It is also not unusual for the incoming serial bit stream to be converted by a receiver, such as the receiver described in “Data Recovery Method And Apparatus,” U.S. patent application Ser. No. 09/670,598 filed on Sep. 29, 2000, to a parallel nine-bit data field that may contain as many as two stuffed bits that must be discarded. In particular, a USB 2.0 transmitting device transmits digital bits over a USB cable using NonReturn-to-Zero Inverted (“NRZI”) encoding techniques. In order to ensure adequate signal transitions, bit stuffing is employed by the USB 2.0 transmitting device. A zero is inserted after every six consecutive ones in the data stream before the data is NRZI encoded, to force a transition in the NRZI data stream. A USB 2.0 receiving device, such as the one described in “Data Recovery Method And Apparatus,” U.S. patent application Ser. No. 09/670,598 filed on Sep. 29, 2000, receives USB 2.0 serial data from a USB wire as a nine-bit parallel data field that may contain up to two previously stuffed data bits. The stuffed data bits do not represent valid data bits and therefore must be discarded. However, the USB 2.0 receiving device does not have a mechanism to identify or discard the stuffed data bits. A method is needed to identify and remove one or two stuffed bits from a received nine-bit parallel data bus.
It is also common in a digital data communication arrangement such as the one described above, to remove prior stuffed bits by creating a nine-bit mask where each mask bit can be used to indicate the validity of each bit in the corresponding data field. This is accomplished by setting to a logic zero (or in an alternate embodiment a logic one) the positions within the mask that correspond to the bits to be discarded in the nine-bit data field. When the mask indicates that one or more bits in the corresponding nine-bit data field are invalid, the nine-bit data field must be decimated to the exact number of valid bits contained within the nine-bit data field. Another problem encountered in digital communications when using USB in particular occurs when a received nine-bit data field contains invalid bits that are indicated as such by using a corresponding mask, as described above. Before the decoded data field can be written to memory, the invalid bits must be removed by decimating the data. What is needed is a technique that removes the invalid bits, compresses the remaining bits into the lowest possible locations of the data field and then creates a new field that indicates the number of bits that are valid within this field.
It is also common in some digital data communication arrangements such as the one described above, to write the destuffed, decimated, incoming seven-, eight-or nine-bit, parallel data into a bit-wise memory controller that will temporarily store the data in a memory buffer until the number of buffered bits of information are equal to the mean number of bits that were sent during a time interval previously agreed upon by the communication system designers. Another problem encountered in digital communications using USB occurs when a received nine-bit data field has been decimated using the technique described above and must be written into memory for storage until enough data bits have been accumulated for delivery to upstream functions for use. What is needed is a method to write incoming, parallel, seven-, eight-or nine-bit data into a bit-wise memory controller that stores the data until eight bits have accumulated.
Thus, the current USB 2.0 macrocell analog front end (AFE) and data recovery (DR) block produce a nine-bit data stream that must be converted to an eight-bit stream at the USB 2.0 peripheral packet interface. Furthermore, the nine-bit data stream includes stuffed bits that must be removed implying that as few as few as seven data bits could be valid after destuffing. Therefore, there is a need for an improved method of destuffing and decimating an incoming data stream.